package edu.zzuli.util;

import org.acegisecurity.providers.encoding.ShaPasswordEncoder;

public class PasswordEncoder {
	
	private static ShaPasswordEncoder encoder;
	static {
		encoder = new ShaPasswordEncoder();
		encoder.setEncodeHashAsBase64(true);
	}

	public static String encode(String str) {
		return encoder.encodePassword(str, null);
	}

	public static void main(String[] args) {
		System.out.println(PasswordEncoder.encode("123456"));
		// W6ph5Mm5Pz8GgiULbPgzG37mj9g=
	}
}
